/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 sagyf Yang. The Four Group.
 */

package app.models.sys;

import com.github.sog.annotation.TableBind;
import com.jfinal.plugin.activerecord.Model;

/**
 * <p>
 * .
 * </p>
 *
 * @author sagyf yang
 * @version 1.0 2014-05-26 17:13
 * @since JDK 1.6
 */
@TableBind(tableName = "ol_brand_merchant", pkName = "merchant")
public class MerchantBrand extends Model<MerchantBrand> {
    public static final  MerchantBrand dao              = new MerchantBrand();
    private static final long          serialVersionUID = 3168871080909373960L;

    public MerchantBrand findByMerchant(long merchant) {
        return findFirst("SELECT merchant, brand FROM ol_brand_merchant WHERE merchant = ?", merchant);
    }

    public MerchantBrand findByBrand(long brand) {
        return findFirst("SELECT merchant, brand FROM ol_brand_merchant WHERE brand = ?", brand);
    }
}
